/*
 * @Author: Bennty
 * @Date: 2024-09-24 13:52:43
 * @LastEditors: Please set LastEditors
 * @LastEditTime: 2024-11-01 11:06:22
 * @Description: 请填写简介
 */
import request from '@/utils/request';


/** 新增半成品信息 */
export const addSemiProductApi = (data:any) =>{
    return request({
        url: '/system/semiProductionInfo',
        method: 'post',
        data: data
    })
};

/** 修改半成品信息 */
export const updateSemiProductApi = (data: any) => {
    return request({
        url: '/system/semiProductionInfo',
        method: 'put',
        data: data
    });
};

/** 查询半成品信息列表 */
export const getSemiProductListApi = (data: any) => {
    return request({
        url: '/system/semiProductionInfo/list',
        method: 'post',
        data: data
    });
};

/** 获取半成品单详细信息 */
export const getSemiProductByIdApi = (id: string | number | undefined) => {
    return request({
        url: `/system/semiProductionInfo/${id}`,
        method: 'get'
    })
};

/** 半成品放入回收站 */
export const deleteSemiProductApi = (id: string | number | undefined) => {
    return request({
        url: `/system/semiProductionInfo/recycleBin`,
        method: 'delete',
        params: {id: id,delFlag:1}
    })
};

/** 获取半成品回收站列表 */
export const getCycleBinSemiProductApi = (data: any) => {
    return request({
        url: `/system/semiProductionInfo/recycleBinList`,
        method: 'post',
        data: data
    })
};

/** 撤销半成品放入回收站 */
export const revokeSemiProductApi = (id: string | number | undefined) => {
    return request({
        url: `/system/semiProductionInfo/recycleBin`,
        method: 'delete',
        params: {id: id,delFlag:0}
    })
};

/** 彻底删除半成品 */
export const totalDeleteSemiProductApi = (id: string | number | undefined) => {
    return request({
        url: `/system/semiProductionInfo/remove`,
        method: 'delete',
        params: {id: id}
    })
};

/** 获取所有工序信息 不分页 */
export const getProcessApi = () => {
    return request({
        url: '/system/workingProcedureInfo/getAll',
        method: 'get'
    })
};

/** 新增半成品组成 */
export const addSemiConstituteInfoApi = (data: any) => {
    return request({
        url: '/system/semiConstituteInfo',
        method: 'post',
        data: data
    })
};

/** 根据半成品id获取所有子部件 */
export const getSemiConstituteInfoApi = (id: any) =>{
    return request({
        url: '/system/semiChildrenProduction/getAllBySemiId',
        method: 'get',
        params: {semiId: id}
    })
};

/** 根据半成品id获取部件 */
export const getConstituteInfoByIdApi = (id: any)=>{
    return request({
        url: '/system/semiConstituteInfo/getBySemiId',
        method: 'get',
        params: {semiId: id}
    })
};

/** 新增半成品单 */
export const orderSemiProductApi = (data: any) => {
    return request({
        url: '/system/semiProduceOrder',
        method: 'post',
        data: data
    })
};

/** 查询保存成品信息列表 */
export const getProductListApi = (data: any) => {
    return request({
        url: '/system/productInfo/list',
        method: 'post',
        data: data
    });
};

/** 获取保存成品信息详细信息 */
export const getProductByIdApi = (id: any) => {
    return request({
        url: `/system/productInfo/${id}`,
        method: 'get',
    });
};

/** 获取所有成品列表不分页 */
export const getProductListNoPageApi = () => {
    return request({
        url: '/system/productInfo/getAllProductList',
        method: 'get'
    });
};

/** 新增成品出入库记录 */
export const addInOutStorageApi = (data: any) => {
    return request({
        url: '/system/productInOutRecord',
        method: 'post',
        data: data
    });
};

/** 计算箱数 */
export const calculateBoxNumberApi = (params: any) => {
    return request({
        url: '/system/productInfo/calculateBoxNumber',
        method: 'get',
        params: params
    })
};

/** 导出保存成品信息列表 */
export const exportProductListApi = ()=>{
    return request({
        url: '/system/productInfo/export',
        method: 'post'
    });
};